'''
Created on 31 Jul 2012

@author: carl.dickinson
'''

from Golfers.models import Golfer, Course, Scorecard, HoleScore
from django.contrib import admin

class GolferAdmin(admin.ModelAdmin):
    fields = ["golferName", "homeCourse", "handicap"]
    
class HoleScoreInline(admin.TabularInline):
    model = HoleScore
    extra = 18    

class ScorecardAdmin(admin.ModelAdmin):
    list_display = ("golferName", "courseName", "netTotal")
    inlines = [HoleScoreInline]
    list_filter = ['date']

admin.site.register(Golfer, GolferAdmin)
admin.site.register(Course)
admin.site.register(Scorecard, ScorecardAdmin)
admin.site.register(HoleScore)


